home *** CD-ROM | disk | FTP | other *** search
- Path: news.vub.ac.be!etro3!kpgoderi
- From: kpgoderi@etro3 (Karel Goderis)
- Newsgroups: comp.lang.c++
- Subject: RW Tools.h++'s persistence - second try
- Date: 24 Jan 1996 14:54:50 GMT
- Organization: Brussels Free Universities VUB/ULB
- Message-ID: <4e5h7q$sip@rc1.vub.ac.be>
- Reply-To: kpgoderi@etro.vub.ac.be
- NNTP-Posting-Host: etro3.vub.ac.be.
- X-Newsreader: TIN [version 1.2 PL2]
-
- Ugh... some newsreaders suck - here is the posting
-
-
- Watch this small piece of code, and then the warnings I get when
- compiling the code. The persistence machinary do write the stuff in a
- decent way, but reading messes up.
-
- class Coordinate : public RWCollectable {
-
- RWDECLARE_COLLECTABLE(Coordinate)
-
- public:
- Coordinate();
-
- int x;
- int y;
-
- //From RwCollectable - for persistence
- virtual void restoreGuts(RWFile& f);
- virtual void restoreGuts(RWvistream& strm);
- virtual void saveGuts(RWFile& f) const;
- virtual void saveGuts(RWvostream& strm) const;
-
- };
-
-
- here follows the code for the persistence stuff . I omitted a lot of the code
-
-
- void Coordinate::restoreGuts(RWvistream& strm)
- {
- RWCollectable::restoreGuts(strm);
-
- strm >> x; // this is line 1144 of the error report
- strm >> y;
-
- }
-
-
-
- ... and the error of the compiler
-
-
- "ROI.cc", line 1144: Warning (Anachronism): Temporary created for
- argument cstr in call to operator>>(RWvistream&, RWCString&).
- "ROI.cc", line 1145: Warning (Anachronism): Temporary created for
- argument cstr in call to operator>>(RWvistream&, RWCString&).
-
-
- ... which makes that every read results in a (-1,-1) coordinate, and that
- is not actually the goal of it :)
-
- --
- Karel Goderis
-
-
- VUB - Vrije Universiteit Brussel
- Personal --- kpgoderi@etro.vub.ac.be
-
- IGUANA - Indepent Group of Unix-alikes and Networking activists
- Personal --- scollie@medelec.uia.ac.be
-
- BEST - Board of European Students of Technology
- General --- twbest00@vub.ac.be
-